<?php
/**
 * 资产包——审核情况
 * User: zhao shou qiang
 * Date: 2018\01\19
 * Time: 15:45
 */

use yii\helpers\Url;

$this->title = '立项评估';
$this->registerCssFile('@web/css/index.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);
$this->registerCssFile('@web/css/mask.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);
$this->registerCssFile('@web/css/AssetPackageDetails.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);
$this->registerCssFile('@web/css/notEdit.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);
$this->registerCssFile('@web/css/paging.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);
$this->registerCssFile('@web/css/select2.min.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);
$this->registerCssFile('@web/css/defaultTheme.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);


$this->registerCss('  
    .wrap > .container-fluid > .container{width: 100%; padding: 0; margin: 0; }
    .edit-tabs{top: 10px;}
    .container.content.content2{top: 0;}
    .wrap{margin: 0;}   
    
    /** 联想搜索 **/
     #province + .select2-container .select2-selection{height: 32px;}
     .select2-results__message{display: none;}
');
$avatar = $data['avatar'];
$editFlag = $data['avatar']['editFlag'];
?>

<?php echo $this->render('header', ['data' => $data, 'isPlan' => $isPlan, 'editFlag' => $editFlag, 'workflow_status'=>$workflow_status,'result'=>$result]); ?>


<style type="text/css">
    .toTop{position: fixed;  bottom: 7%; right: 2%; z-index: 99;}
</style>

<!-- 一键置顶开始 -->
<div class="toTop">
    <img src="/image/common/clickTop.png">
</div>
<!-- 一键置顶结束 -->

<script type="text/javascript">
    // 一键置顶 点击
    $('.toTop').click(function() {
        $("html,body").animate({ scrollTop: 0 }, 100);
    });
</script>



<!-- 申请立项 -->
<div class="modal fade" id="AssetPackageEditing-approval" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
</div>
<!-- 页内导航   开始-->
<div class="container edit-tabs">
    <div class="row">
        <ul class="edit-tabs-ul1">
            <li class="pull-left edit-tabs-li1 jbqk" data-title="packageDetail">
                <a href="<?php
                echo Url::toRoute(['package/detail-info', 'packageid' => $data['id']]);
                ?>">基本情况</a>
                <ul class="edit-tabs-ul2 " style="display: none;">
                    <li class="pull-left active" id="jbqk1-link"><a href="###">基本信息</a></li>
                    <li class="pull-left " id="jbqk2-link"><a href="###">转让信息</a></li>
                    <li class="pull-left " id="jbqk3-link"><a href="###">流转、前期处置及维护情况</a></li>
                    <li class="pull-left " id="jbqk4-link"><a href="###">项目清单</a></li>
                </ul>
            </li>
            <li class="pull-left active edit-tabs-li1 jdpg">
<!--                <a href="--><?php
//                echo Url::toRoute(['package/initiation', 'packageid' => $data['id']]);
//                ?><!--">尽调评估</a>-->
                立项评估
                <ul class="edit-tabs-ul2" style="display: block;">
                    <li class="pull-left active" id="jdpg1-link"><a href="###">立项信息</a></li>
                    <li class="pull-left " id="jdpg6-link"><a href="###">报价信息</a></li> <!-- unclick -->
                    <li class="pull-left " id="jdpg2-link"><a href="###">团队组成</a></li>
                    <li class="pull-left " id="jdpg3-link"><a href="###">工作计划</a></li>
                    <li class="pull-left " id="jdpg4-link"><a href="###">团队受益分配</a></li>
                    <li class="pull-left " id="jdpg5-link"><a href="###">其他</a></li>
                </ul>
            </li>
            <li class="pull-left edit-tabs-li1 shqk">
                <a href="<?php
                echo Url::toRoute(['package/audit-feedback', 'packageid' => $data['id']]);
                ?>">审核情况</a>
                <ul class="edit-tabs-ul2" style="display: none;">
                    <li class="pull-left active"><a href="###">审核状况</a></li>
                </ul>
            </li>
            <li class="pull-left edit-tabs-li1 czrz" data-title="packageLog">
                <a href="<?php
                echo Url::toRoute(['package/log', 'packageid' => $data['id']]);
                ?>">操作日志</a>
                <ul class="edit-tabs-ul2" style="display: none;">
                    <li class="pull-left active" id="czrz1-link"><a href="###">操作记录</a></li>
                    <li class="pull-left " id="czrz2-link"><a href="###">数据更新纪录</a></li>
                </ul>
            </li>
        </ul>
    </div>
</div>
<!-- 页内导航   结束-->

<!-- 尽凋评估 开始 -->
<div class="container-fluid AssetPackageInformationEditing package_initiation_img_edit">
    <?php echo $this->render('package-investigation', ['data' => $data, 'editFlag' => $editFlag]); ?>
</div>
<!-- 尽凋评估 结束 -->

<input type="hidden" id="base_url" value="<?php echo Yii::$app->request->hostInfo; ?>">


<?php echo $this->render('footer', ['data' => $data]); ?>

<script type="text/javascript">
     // 尽调评估下锚点
    $(".AssetPackageInformationEditing").css({
        'margin-top' : '10px'
    });
    // 1 尽调评估 -立项信息
    $("#jdpg1-link").click(function() {
        if (!$(this).hasClass("unclick")) {
            // $(this).addClass("active").siblings().removeClass("active");
            $("#jdpg1-link").parent().find("li").removeClass("active");
            $("#jdpg1-link").addClass("active");
            $("html, body").animate({scrollTop: $("#jdpg1").offset().top - 110 }, {duration: 1,easing: "swing"});
            return false;
        }
    });
    // 2.尽调评估- 团队组成
    $("#jdpg2-link").click(function() {
        if (!$(this).hasClass("unclick")) {
            $("#jdpg2-link").parent().find("li").removeClass("active");
            $("#jdpg2-link").addClass("active");
            $("html, body").animate({scrollTop: $("#jdpg2").offset().top - 110 }, {duration: 1,easing: "swing"});
            return false;
        }
    });
    // 3.尽调评估- 工作计划
    $("#jdpg3-link").click(function() {
        if (!$(this).hasClass("unclick")) {
            $("#jdpg3-link").parent().find("li").removeClass("active");
            $("#jdpg3-link").addClass("active");
             $("html, body").animate({scrollTop: $("#jdpg3").offset().top - 110 }, {duration: 1,easing: "swing"});
            return false;
        }
    });
    // 4.尽调评估- 团队收益分配
    $("#jdpg4-link").click(function() {
        if (!$(this).hasClass("unclick")) {
            $("#jdpg4-link").parent().find("li").removeClass("active");
            $(this).addClass("active");
             $("html, body").animate({scrollTop: $("#jdpg4").offset().top - 110 }, {duration: 1,easing: "swing"});
            return false;
        }
    });
     // 5.尽调评估- 其他
    $("#jdpg5-link").click(function() {
        if (!$(this).hasClass("unclick")) {
            $("#jdpg5-link").parent().find("li").removeClass("active");
            $(this).addClass("active");
             $("html, body").animate({scrollTop: $("#jdpg5").offset().top - 110 }, {duration: 1,easing: "swing"});
            return false;
        }
    });
    // 6.尽调评估- 报价信息
    $("#jdpg6-link").click(function() {
        if (!$(this).hasClass("unclick")) {
            $("#jdpg6-link").parent().find("li").removeClass("active");
            $(this).addClass("active");
            $("html, body").animate({scrollTop: $("#jdpg6").offset().top - 110 }, {duration: 1,easing: "swing"});
            return false;
        }
    });
    
    //滚动条滚动到指定位置触发下面事件
    var jdpg1 = $("#jdpg1");
    var offSetjdpg1 = jdpg1.offset().top - 110;
    var jdpg2 = $("#jdpg2");
    var offSetjdpg2 = jdpg2.offset().top - 110;
    var jdpg3 = $("#jdpg3");
    var offSetjdpg3 = jdpg3.offset().top - 110;
    var jdpg4 = $("#jdpg4");
    var offSetjdpg4 = jdpg4.offset().top - 110;
    var jdpg5 = $("#jdpg5");
    var offSetjdpg5 = jdpg5.offset().top - 110;
    var jdpg6 = $("#jdpg6");
    var offSetjdpg6 = jdpg6.offset().top - 110;
    $(window).scroll(function(){
        //console.log($(window).scrollTop());
        if ($(window).scrollTop() >= offSetjdpg1 &&  $(window).scrollTop() < offSetjdpg6){
            $("#jdpg1-link").addClass("active").siblings("li").removeClass("active");
        }else if ($(window).scrollTop() >= offSetjdpg6  &&  $(window).scrollTop() < offSetjdpg2){
            $("#jdpg6-link").addClass("active").siblings("li").removeClass("active");
        }else if ($(window).scrollTop() >= offSetjdpg2 &&  $(window).scrollTop() < offSetjdpg3){
            $("#jdpg2-link").addClass("active").siblings("li").removeClass("active");
        }else if ($(window).scrollTop() >= offSetjdpg3 &&  $(window).scrollTop() < offSetjdpg4){
            $("#jdpg3-link").addClass("active").siblings("li").removeClass("active");
        }else if ($(window).scrollTop() >= offSetjdpg4 &&  $(window).scrollTop() < offSetjdpg5){
            $("#jdpg4-link").addClass("active").siblings("li").removeClass("active");
        }else if ($(window).scrollTop() >= offSetjdpg5){
            $("#jdpg5-link").addClass("active").siblings("li").removeClass("active");
        }
    });
</script>
